//
//  HomeNavBarView.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/3/27.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class HomeNavBarView: UIView {
    
    var handlerClosure: ((_ isSearch: Bool) -> Void)?

    @IBOutlet weak var searchView: UIView! {
        didSet {
            searchView.layer.cornerRadius = searchView.height / 2
            
            let tap = UITapGestureRecognizer(target: self, action: #selector(searchAction))
            searchView.addGestureRecognizer(tap)
        }
    }
    
    @IBOutlet weak var msgBtn: UIButton!
    
    @IBAction private func msgBtnAction(_ sender: UIButton) {
        handlerClosure?(false)
    }
    
    @objc private func searchAction() {
        handlerClosure?(true)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        backgroundColor = .clear
    }
}
